
             
/**
 * 
 *
 * @File name:  UpdateTDepartmentAction.java   修改【部门信息:T_DEPARTMENT】
 * @Create on:  2011-10-30 19:25:186
 * @Author   :  陈伟
 *
 * @ChangeList
 * ---------------------------------------------------
 * Date         Editor              ChangeReasons
 *
 */
           
        

package com.boho.estates.department.action;

            
import java.sql.Connection;

import cn.boho.framework.actions.ActionImp;
import cn.boho.framework.context.ActionContext;
import cn.boho.framework.exception.UserOperationException;
import cn.boho.framework.po.POUtils;
import cn.boho.framework.service.MessageService;

import com.boho.common.SystemUtils;
import com.boho.estates.po.TDepartmentPO;
            
        
public class UpdateTDepartmentAction extends ActionImp {
	private TDepartmentPO conditionTDepartmentPO = new TDepartmentPO();
	private TDepartmentPO valueTDepartmentPO = new TDepartmentPO();
	private Connection con=null;
	@Override
	protected void doException(ActionContext atx, Exception ex) {
		if (!(ex instanceof UserOperationException)) {
			atx.setErrorContext("BOHO_COMMON_1002", MessageService.getMessage("BOHO_COMMON_1002"),"【部门信息】" ,ex);
		}
	}
	@Override
	protected int performExecute(ActionContext atx) throws Exception {
		POUtils.update(con, conditionTDepartmentPO, valueTDepartmentPO,false);
		return 1;
	}
	@Override
	protected int verifyParameters(ActionContext atx) throws Exception {
		con = atx.getConection();
		String updateBy = SystemUtils.getSessionUser(atx);
		conditionTDepartmentPO.setDepartmentNo(atx.getIntegerValue("DEPARTMENT_NO",-1));
		valueTDepartmentPO.setDepartmentName(atx.getStringValue("DEPARTMENT_NAME"));
		valueTDepartmentPO.setUpdateDate(new java.util.Date());
		valueTDepartmentPO.setUpdateBy(updateBy);
		return 1;
	}
}
